import React, { Component } from 'react'
import Qcevents from "../utils/events"
class Body extends Component {
  state = {
      ind:0 // 用于选中某项的下标
  }
  componentDidMount(){
    Qcevents.addListener("ind",this.fn)
  }
  fn = (data)=>{
        console.log(data);
        this.setState({
            ind:data
        })
  }
  aaa = ()=>{
      return`<div>11111</div>`
  }
  render() {
    return (
      <div>
          {
            this.props.send&& this.props.send.length && this.props.send[this.state.ind]?<div> {this.props.send[this.state.ind].content}</div>:"暂无数据"
          }
          {
              <p>{this.aaa()}</p>
          }
      </div>
    )
  }
}

export default Body